#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>

class Document;
class View;

class MainWindow : public QMainWindow
{
	friend class Application;
	Q_OBJECT

public:
	MainWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
	~MainWindow();

	QPointer<View> activeView() const;
	QPointer<Document> activeDocument() const;
protected:
	void closeEvent(QCloseEvent * event);
private:
	void saveSettings();
	void restoreSettings();

	void createActions();
	void createMenus();

	QPointer<QMdiArea> m_mdiArea;

	QPointer<QAction> m_fileNew;
	QPointer<QAction> m_fileOpen;
	QPointer<QAction> m_fileExit;

	QPointer<QMenu>   m_fileMenu;
private slots:
	void windowActivated();
	void onFileNew();
	void onFileOpen();
	void onFileExit();
};

#endif // MAINWINDOW_H
